package com.njwt.cloud.mscommon.feign.fallback;

import com.njwt.cloud.mscommon.feign.client.UserClient;
import com.njwt.cloud.mscommon.support.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <a href="mailto:xingxiaofeng@gtmap.cn">xingxiaofeng</a>
 * @date 2022-06-22
 * @desc UserClientFallBack
 */
public class UserClientFallBack implements UserClient {
    private final Logger logger= LoggerFactory.getLogger(this.getClass());
    @Override
    public ApiResponse getUserByUserName(String username) {
        logger.error("调用user-provider服务getAuthorityByUserId方法失败!");
        return  ApiResponse.hystrixError("user-provider", "getUserByUserName");
    }

    @Override
    public ApiResponse loadUserByUserId(String id) {
        logger.error("调用user-provider服务loadUserByUserId方法失败!");
        return  ApiResponse.hystrixError("user-provider", "loadUserByUserId");
    }
}
